package kr.re.etri.snsenabler.client;


public class CopyOfProperties {

//	private static final TwitterServiceAsync SERVICE = GWT.create(TwitterService.class);
//	private static PropertiesUiBinder uiBinder = GWT.create(PropertiesUiBinder.class);
//
//	interface PropertiesUiBinder extends UiBinder<Widget, CopyOfProperties> {
//	}
//
//	private Dialog dialog;
//	@UiField TextButton fetchAuthorizationUrlButton;
//	@UiField TextButton authorizeButton;
//	@UiField TextField verifierTextField;
//	@UiField TextButton sendVerifierButton;
//	@UiField TextButton getUserTimelineButton;
//	private final ServiceProviderTreeData serviceProviderData;
//	private String authorizationUrl;
//	private User user;
//
//	public CopyOfProperties(ServiceProviderTreeData serviceProviderData) {
//		dialog = (Dialog)uiBinder.createAndBindUi(this);
//		dialog.setHeadingText(I18NConstants.C.propertiesDialogTitle() + " - " + serviceProviderData.getTitle());
//
//		this.serviceProviderData = serviceProviderData;
//	}
//
//	protected Dialog getDialog() {
//		return dialog;
//	}
//
//	@UiHandler("fetchAuthorizationUrlButton")
//	public void onFetchAuthorizationUrlButtonClicked(SelectEvent event) {
//		SERVICE.fetchAuthorizationUrl(serviceProviderData.getName(), new AsyncCallback<LoginResult>() {
//
//			@Override
//			public void onSuccess(LoginResult result) {
//				GWT.log("authorizationUrl: " + result.getAuthorizationUrl());
//				CopyOfProperties.this.authorizationUrl = result.getAuthorizationUrl();
//				authorizeButton.setEnabled(true);
//				verifierTextField.setEnabled(true);
//				sendVerifierButton.setEnabled(true);
//			}
//
//			@Override
//			public void onFailure(Throwable caught) {
//				GWT.log("authorize: " + caught.getMessage());
//			}
//		});
//	}
//
//	@UiHandler("authorizeButton")
//	public void onAuthorizeButtonClicked(SelectEvent event) {
//		Window.open(authorizationUrl, "Authorization", "");
//		GWT.log("Window opened");
//	}
//
//	@UiHandler("sendVerifierButton")
//	public void onSendVerifierButtonClicked(SelectEvent event) {
//		SERVICE.sendVerifier(serviceProviderData.getName(), verifierTextField.getText().trim(), new AsyncCallback<LoginResult>() {
//			public void onSuccess(LoginResult result) {
//				GWT.log("result: " + result.getUser());
//				CopyOfProperties.this.user = result.getUser();
//				getUserTimelineButton.setEnabled(true);
//				fetchAuthorizationUrlButton.setEnabled(false);
//				authorizeButton.setEnabled(false);
//				verifierTextField.setEnabled(false);
//				sendVerifierButton.setEnabled(false);
//			}
//
//			public void onFailure(Throwable caught) {
//				GWT.log("sendVerifier: " + caught.getMessage());
//			}
//		});
//	}
//
//	@UiHandler("getUserTimelineButton")
//	public void onGetUserTimelineButtonClicked(SelectEvent event) {
//		SERVICE.getUserTimeline(user.getScreenName(), new AsyncCallback<Void>() {
//			public void onSuccess(Void result) {
//			}
//
//			public void onFailure(Throwable caught) {
//				GWT.log("getUserTimeline: " + caught.getMessage());
//			}
//		});
//	}
}
